package chapter13;

import java.util.Queue;

public class ComparableSquare extends Square implements Comparable<ComparableSquare>{

    public ComparableSquare(double size){super(size);}

    @Override
    public int compareTo(ComparableSquare o) {
        if (getPerimeter()>o.getPerimeter())
            return 1;
        else if (getPerimeter() < o.getPerimeter())
            return -1;
        else
            return 0;
    }

    @Override
    public String toString() {
        return "SquareArea: " +getArea()+"  SquarePerimeter" + getPerimeter();
    }
}
